﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Gao.Poker.Domain;

namespace Gao.Poker.App.Print
{
    /// <summary>
    /// Interaction logic for StorePrint.xaml
    /// </summary>
    public partial class StorePrint : Page
    {
        public StorePrint()
        {
            InitializeComponent();
        }

        public void SetPrintValues(Member member,IList<ProductHelper> list,Decimal monetary)
        {
            tbMemberName.Text = String.Format("会员名 {0}", member.Name);
            tbCardNo.Text = String.Format("卡号 {0}", member.CardNo);
            tbDate.Text = String.Format("日期 {0}", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
            foreach (var productHelper in list)
            {
                var tb = new TextBlock();
                tb.Text = String.Format("{0}---{1}---{2}", productHelper.ProductName, productHelper.PIntegral, productHelper.PNumber);
                sp.Children.Add(tb);
            }
            tbMoney.Text = String.Format("总计 {0}", monetary);
            tbBalance.Text = String.Format("剩余积分 {0}", member.Points);
        }
    }
}
